package com.topscomm.main.config;

import com.topscomm.mpm.service.*;
import org.springframework.context.annotation.Bean;
import org.springframework.remoting.caucho.HessianServiceExporter;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Description TODO
 * @Classname HessianServerConfig
 * @Date 2021/10/22
 * @Created by jiangtao
 */
@Component
public class HessianServerConfig {
	@Resource
	private IMpmProjectService mpmProjectService;
	@Resource
	private IMpmProjectTeamService mpmProjectTeamService;
	@Resource
	private IMpmProjectCustomerService mpmProjectCustomerService;
	@Resource
	private IMpmProjectSaleService mpmProjectSaleService;
	@Resource
	private IMpmProjectStakeholderService mpmProjectStakeholderService;

	@Bean(name ="/mpmHessian/mpmProjectService")
	public HessianServiceExporter  exportMpmProjectService(){
		HessianServiceExporter exporter = new HessianServiceExporter();
		exporter.setService(mpmProjectService);
		exporter.setServiceInterface(IMpmProjectService.class);
		return exporter;
	}
	@Bean(name ="/mpmHessian/mpmProjectSaleService")
	public HessianServiceExporter  exportMpmProjecSaletService(){
		HessianServiceExporter exporter = new HessianServiceExporter();
		exporter.setService(mpmProjectSaleService);
		exporter.setServiceInterface(IMpmProjectSaleService.class);
		return exporter;
	}

	@Bean(name ="/mpmHessian/mpmProjectTeamService")
	public HessianServiceExporter  exportMpmProjectTeamService(){
		HessianServiceExporter exporter = new HessianServiceExporter();
		exporter.setService(mpmProjectTeamService);
		exporter.setServiceInterface(IMpmProjectTeamService.class);
		return exporter;
	}

	@Bean(name ="/mpmHessian/mpmProjectCustomerService")
	public HessianServiceExporter  exportMpmProjectCustomerService(){
		HessianServiceExporter exporter = new HessianServiceExporter();
		exporter.setService(mpmProjectCustomerService);
		exporter.setServiceInterface(IMpmProjectCustomerService.class);
		return exporter;
	}

	@Bean(name = "/mpmHessian/mpmProjectStakeholderService")
	public HessianServiceExporter exportMpmProjectStakeholderService() {
		HessianServiceExporter exporter = new HessianServiceExporter();
		exporter.setService(mpmProjectStakeholderService);
		exporter.setServiceInterface(IMpmProjectStakeholderService.class);
		return exporter;
	}
}
